1. The Field of the Invention
The present invention relates to a data storage unit represented by a hard disk drive (HDD) and, more particularly, to a method of selecting a next-to-be-executed command from among write or read commands.
2. The Relevant Art
An HDD is one of the most popular external storages used for a computer. The HDD has a magnetic head for reading data stored in a magnetic disk and for writing data into the magnetic disk. The magnetic head is held on an actuator mechanism which is swung by a voice coil motor (VCM). In order for the magnetic head to perform a data read or write operation, the magnetic head is moved and positioned to (seeks) a predetermined track on the magnetic disk by driving the actuator mechanism. The track includes a plurality of sectors, each of which is a minimum unit for data storage. The magnetic head is controlled to move to a predetermined location with the assistance of servo information stored on the magnetic disk.
A write command and a read command (both of which are hereinafter generally referred to as a command) issued from the computer to the HDD are held (queued) in a command queue (hereinafter simply referred to as a queue) in the HDD. A plurality of commands held in the queue are ordered for execution. For a write command, the term “execution” used herein refers to an operation for writing data contained in the write command to a predetermined location on a magnetic disk through a magnetic head. For a read command, it refers to an operation for reading data from a predetermined location on the magnetic disk through the magnetic head. A command execution order is determined according to a technique. In this technique, only one command is selected from all commands held in the queue, based on seek times (the times from the beginning of seek for target tracks on the magnetic disk to the arrival at the target tracks) and disk latency times (the times from the arrival to the beginning of accessing the target sectors), so that the selected command specifies a start sector which is accessible by the shortest time period from the end sector specified by the last selected command. This technique is intended to improve the performance of read and write operations on an HDD.
The above-mentioned technique is suitable to ensure the selection of an executable command in a minimum time. However, this technique may suffer from some problems as described below when a queue holds many commands (which is hereinafter expressed as a “deep queue”). According to the prior command selection method described above, a seek time (the time from the beginning of a seek to a target track on a magnetic disk to the arrival at that track) and a disk latency time (the time from the arrival to the beginning of access to the target sector) are calculated (scanned) for all commands held in a queue. Therefore, in the prior technique there may be a rotational wait because it is not possible to select a command with an execution waiting time shorter than the time required for this scanning. There may also be a rotational wait when there is not a sufficient time to scan all commands. Most modern HDDs can hold 64 or more commands in a queue and thus, the deeper queue may bring about more significant performance degradation due to the above-mentioned problems.
It is, therefore, an object of the present invention to provide an executable command selection method which can improve the performance for deeper queues as compared with the prior technique. It is another object of the present invention to provide a data storage unit to which the executable command selection method is applicable. It is still another object of the present invention to provide a data processing method to which the executable command selection method is applicable.